﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RevClinic.Core.Domain
{
    public class UserInfo : ValueObject<UserInfo>
    {
        public string Login { get; protected set; }
        public string Password { get; protected set; }
        public string FirstName { get; protected set; }
        public string Surname { get; protected set; }
        public UserType Type { get; protected set; }

        public UserInfo()
        {

        }

        public UserInfo(string login, string password, string firstName, string surname) :
            this(login, password, firstName, surname, UserType.Recepcionist)
        { }

        public UserInfo(string login, string password, string firstName, string surname, UserType type)
        {
            Check.Argument.IsNotNullOrEmpty(login, "login");
            Check.Argument.IsNotNullOrEmpty(password, "password");
            Check.Argument.IsNotNullOrEmpty(firstName, "firstName");
            Check.Argument.IsNotNullOrEmpty(surname, "surname");
            Check.Argument.IsNotNull(type, "type");
            Login = login;
            Password = password;
            FirstName = firstName;
            Surname = surname;
            Type = type;
        }

        protected override IEnumerable<object> GetAtomicValues()
        {
            yield return Login;
            yield return Password;
            yield return FirstName;
            yield return Surname;
            yield return Type;
        }
    }
}
